/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.fi.muni.diplomka.common;

import java.util.ArrayList;
import java.util.List;

/**
 * Class representing Army of Player
 *
 * @author Jakub Kutil
 */
public class Army {

    private Long playerId;
    private List<Squad> squads;

    public Army() {
        this.squads = new ArrayList<>();
    }

    public Long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(Long playerId) {
        this.playerId = playerId;
    }

    public List<Squad> getSquads() {
        return squads;
    }

    public void setSquads(List<Squad> squads) {
        this.squads = squads;
    }

    public Squad getSquadAtPosition(int position) {
        for (int i = 0; i < squads.size(); i++) {
            if (squads.get(i).getPosition() == position) {
                return squads.get(i);
            }
        }
        return null;
    }
}
